package com.cros.file.regex;

import java.io.*;
class Player {
	Player() { System.out.print("p"); }
}

public class CardPlayer extends Player implements Serializable {
	CardPlayer() { 
		System.out.print("c"); 
	}
	public static void main(String[] args) {
		CardPlayer c1 = new CardPlayer();
		try {
			FileOutputStream fos = new FileOutputStream("play.txt");
			ObjectOutputStream os = new ObjectOutputStream(fos);
			os.writeObject(c1);
			os.close();
			FileInputStream fis = new FileInputStream("play.txt");
			ObjectInputStream is = new ObjectInputStream(fis);
			CardPlayer c2 = (CardPlayer) is.readObject();
			is.close();
		} catch (Exception x ) { }
	}
}

/*
 * C is correct. It's okay for a class to implement Serializable even if its superclass doesn't.
However, when you deserialize such an object, the non-serializable superclass must run its
constructor. Remember, constructors don't run on deserialized classes that implement
Serializable.*/

class TKO {
	public static void main(String[] args) {
		String s = "-";
		
		Integer x = 343;
		
		long L343 = 343L;
		
		if(x.equals(L343)) s += ".e1 ";
		
		if(x.equals(343)) s += ".e2 ";
		
		Short s1 = (short)((new Short((short)343)) / (new Short((short)49)));
		
		if(s1 == 7) s += "=s ";
		
		if(s1 < new Integer(7+1)) s += "fly ";
		
		System.out.println(s);
	} 
}


/* B, C, and D are correct. Remember, that the equals() method for the integer wrappers
will only return true if the two primitive types and the two values are equal. With C, it's
okay to unbox and use ==. For D, it's okay to create a wrapper object with an expression,
and unbox it for comparison with a primitive.*/